<template>
	<div class="home">
		<home-header :city='city'></home-header>
		<home-swiper :list = 'swiperList'></home-swiper>
		<home-icons :iconslist = 'iconslist'></home-icons>
		<home-recmond></home-recmond>
		<home-weekend></home-weekend>
	</div>
</template>
<script>
import HomeHeader from './components/Header.vue'
import HomeSwiper from './components/Swiper.vue'
import HomeIcons from './components/Icons.vue'
import homeRecmond from './components/Recommend.vue'
import homeWeekend from './components/Weekend.vue'
import axios from 'axios'
export default{
	   name:'Home',
		data(){
			return{
				city:'',
				swiperList:[],
				iconslist:[]
			}
		},
		components:{
			HomeHeader,
			HomeSwiper,
			HomeIcons,
			homeRecmond,
			homeWeekend
		},
		methods:{
			getHomeInfo(){
				axios.get('/api/index.json').then(
					this.getHomeInfoSucc
				)
			},
			getHomeInfoSucc(res){
				res = res.data;
				if(res.ret && res.data){
					const data = res.data;
					this.city = data.city;
					this.swiperList = data.swiperList;
					this.iconslist = data.iconList;

				}
				console.log(res.data)
			}
		},
		mounted(){
			this.getHomeInfo();
		},

	}

</script>

<style></style>